﻿<div ng-controller="StockHistoryController as ctrl">
    <h3>Stock History : {{Symbol}}</h3>
    <div class="well">
        <div class="form-group">
            <div class="label label-default">Symbol</div>
            <input type="text" class="form-control" placeholder="Stock Symbol" ng-model="ctrl.Symbol" ng-keyup="ctrl.GetHistory()"/>
        </div>
        <div class="form-group">
            <div class="label label-default">Starting Date</div>
            <input type="text" class="form-control" placeholder="Start" ng-model="ctrl.StartDate" ng-keyup="ctrl.GetHistory()"/>
        </div>
            <div class="form-group">
                <div class="label label-default">Ending Date</div>
                <input type="text" class="form-control" placeholder="End" ng-model="ctrl.EndDate" ng-keyup="ctrl.GetHistory()"/>
                </div>
            </div>
    <div class="mychart">
        <nvd3 data="ctrl.Data" options="ctrl.Options"></nvd3>
    </div>
    <div class="table-responsive">
        <table class="table table-condensed table-striped">
            <thead>
                <tr>
                    <th>Date</th>
                    <th>Low</th>
                    <th>High</th>
                    <th>Adjusted Close</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="stock in ctrl.StockQuotes">
                    <td>{{stock.Date.toLocaleDateString()}}</td>
                    <td>{{stock.Low}}</td>
                    <td>{{stock.High}}</td>
                    <td>{{stock.AdjustedClose}}</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>